package com.example.administrator.androidbuglyproject;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.meituan.android.walle.ChannelInfo;
import com.meituan.android.walle.WalleChannelReader;
import com.tencent.bugly.crashreport.CrashReport;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final TextView textView = (TextView) findViewById(R.id.testBugly);

        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                CrashReport.testJavaCrash();
                ChannelInfo channelInfo= WalleChannelReader.getChannelInfo(MainActivity.this);
                Toast.makeText(MainActivity.this, "find bug, fixed " + channelInfo.getChannel(), Toast.LENGTH_SHORT).show();
                textView.setText("fixed bug");
            }
        });
    }
}
